import { IDiceHand } from "../../common/dice/interfaces/IDiceHand";
//class HumanHand
    
    export  class HumanHand /* flash.display.Sprite */ implements IDiceHand
    {
        constructor(arg1: Object /* flash.display.MovieClip */)
        {
            
            this.range = new Object /* flash.geom.Rectangle */();
            this._animateMc = arg1;
            var loc1;
            this._animateMc.y = loc1 = 0;
            this._animateMc.x = loc1;
            this.addChild(this._animateMc);
            this._animateMc.gotoAndStop(1);
            this.mouseEnabled = loc1 = false;
            this.mouseChildren = loc1;
            return;
        }

        public show(arg1: Object /* flash.display.DisplayObjectContainer */): void
        {
            arg1.addChild(this);
            return;
        }

        public hide(): void
        {
            if (this.parent) 
            {
                this.parent.removeChild(this);
            }
            return;
        }

        public mouseOver(): void
        {
            this._animateMc.gotoAndStop("over");
            return;
        }

        public mouseDown(): void
        {
            this._animateMc.gotoAndPlay("down");
            return;
        }

        public mouseUp(): void
        {
            this._animateMc.gotoAndPlay("up");
            this.addEventListener(flash.events.Event.ENTER_FRAME, this.onEnterFrameHandler);
            return;
        }

        /* internal  */onEnterFrameHandler(arg1: Object /* flash.events.Event */): void
        {
            if (this._animateMc.currentLabel == "remove") 
            {
                this.mouseOver();
                this.removeEventListener(flash.events.Event.ENTER_FRAME, this.onEnterFrameHandler);
            }
            return;
        }

        /* internal */ /* var */range: Object /* flash.geom.Rectangle */;

        /* internal */ /* var */_animateMc: Object /* flash.display.MovieClip */;
    }
